import Vue from 'vue'
import Router from 'vue-router'

const login = () => import('./views/login')
const error = () => import('./views/error')
const main = () => import('./views/main')

const comManage = () => import('./views/comManage/index')

const addOrEditCom = () => import('./views/comManage/infoList/addOrEditCom')
const addOrEditGoods = () => import('./views/comManage/infoList/addOrEditGoods')
const addOrEditServe = () => import('./views/comManage/infoList/addOrEditServe')
const comList = () => import('./views/comManage/infoList/comList')
const goodsList = () => import('./views/comManage/infoList/goodsList')
const servesList = () => import('./views/comManage/infoList/servesList')

const goodsPlan = () => import('./views/comManage/infoList/goodsPlan')

const infoRecheck = () => import('./views/comManage/infoRecheck/infoRecheck')
const comInfo = () => import('./views/comManage/infoRecheck/comInfo')
const goodsInfo = () => import('./views/comManage/infoRecheck/goodsInfo')
const serveInfo = () => import('./views/comManage/infoRecheck/serveInfo')

const hosNetwork = () => import('./views/hosNetwork/index')
const netHospital = () => import('./views/hosNetwork/hospital/hospital')
const hospitalAdd = () => import('./views/hosNetwork/hospital/controls/hosAdd')
const addDoc = () => import('./views/hosNetwork/doctor/controls/addDoc')
const netDoctor = () => import('./views/hosNetwork/doctor/doctor')
const netPhyExamination = () => import('./views/hosNetwork/phyExamination/phyExamination')
const addOrg = () => import('./views/common/addOrg')
const branch = () => import('./views/hosNetwork/branch/branch')
const branchAdd = () => import('./views/hosNetwork/branch/controls/branchAdd')
const netChMedicine = () => import('./views/hosNetwork/chMedicine/chMedicine')
const netDentistry = () => import('./views/hosNetwork/dentistry/dentistry')
const userManage = () => import('./views/userManage/index')
const userList = () => import('./views/userManage/userList/userList')
const userFiled = () => import('./views/userManage/userFiled/userFiled')
const userCheck = () => import('./views/userManage/userCheck/userCheck')
const addUser = () => import('./views/userManage/userList/controls/addUser')
const addUserfiled = () => import('./views/userManage/userFiled/controls/addUserfiled')
const addUserCheck = () => import('./views/userManage/userCheck/controls/addUserCheck')
const userDetail = () => import('./views/userManage/userList/controls/userDetail')
const userDisPath = () => import('./views/userManage/userList/controls/userDisPath')
const userPath = () => import('./views/userManage/userList/controls/userPathChose')
const userDate = () => import('./views/userManage/userList/controls/userDate')
const wordBook = () => import('./views/wordBook/index')
const department = () => import('./views/wordBook/department')
const doctorTitle = () => import('./views/wordBook/doctorTitle')
const hosLevel = () => import('./views/wordBook/hosLevel')
const skillTag = () => import('./views/wordBook/skillTag')
const region = () => import('./views/wordBook/region')
const systemManage = () => import('./views/systemManage/index')
const systemRole = () => import('./views/systemManage/systemRole/systemRole')
const systemUser = () => import('./views/systemManage/systemUser/systemUser')
const roleNew = () => import('./views/systemManage/systemRole/controls/roleNew')

const product = () => import('./views/productManage/index')
const productManage = () => import('./views/productManage/productManage')
const productMain = () => import('./views/productManage/productMain')
const order = () => import('./views/orderManage/index')
const orderManage = () => import('./views/orderManage/orderManage')
const orderMain = () => import('./views/orderManage/orderMain')
const orderWait = () => import('./views/orderManage/orderWait')

Vue.use(Router)

export default new Router({
  mode: 'hash',
  // base: '/uplus',
  routes: [
    {
      path: '/error',
      component: error
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/',
      name: 'main',
      component: main,
      children: [
        {
          path: 'comManage',
          component: comManage,
          children: [
            {
              path: 'comList',
              component: comList
            },
            {
              path: 'infoRecheck',
              component: infoRecheck
            },
            {
              path: 'comInfo',
              component: comInfo
            },
            {
              path: 'goodsInfo',
              component: goodsInfo
            },
            {
              path: 'serveInfo',
              component: serveInfo
            },
            {
              path: 'addOrEditCom',
              component: addOrEditCom
            },
            {
              path: 'servesList',
              component: servesList
            },
            {
              path: 'addOrEditServe',
              component: addOrEditServe
            },
            {
              path: 'goodsList',
              component: goodsList
            },
            {
              path: 'addOrEditGoods',
              component: addOrEditGoods
            },
            {
              path: 'goodsPlan',
              component: goodsPlan
            }
          ]
        },
        {
          path: 'hosNetwork',
          component: hosNetwork,
          children: [
            {
              path: 'hospital',
              component: netHospital
            },
            {
              path: 'hospitalAdd',
              component: hospitalAdd
            },
            {
              path: 'doctor',
              component: netDoctor
            },
            {
              path: 'addDoc',
              component: addDoc
            },
            {
              path: 'phyExamination',
              component: netPhyExamination
            },
            {
              path: 'addOrg',
              component: addOrg
            },
            {
              path: 'branch',
              component: branch
            },
            {
              path: 'branchAdd',
              component: branchAdd
            },
            {
              path: 'chMedicine',
              component: netChMedicine
            },
            {
              path: 'dentistry',
              component: netDentistry
            }
          ]
        },
        {
          path: 'userManage',
          component: userManage,
          children: [
            {
              path: 'userList',
              component: userList
            },
            {
              path: 'userFiled',
              component: userFiled
            },
            {
              path: 'userCheck',
              component: userCheck
            },
            {
              path: 'addUser',
              component: addUser
            },
            {
              path: 'addUserfiled',
              component: addUserfiled
            },
            {
              path: 'addUserCheck',
              component: addUserCheck
            },
            {
              path: 'userDetail',
              component: userDetail
            },
            {
              path: 'userDisPath',
              component: userDisPath
            },
            {
              path: 'userPath',
              component: userPath
            },
            {
              path: 'userDate',
              component: userDate
            }
          ]
        },
        {
          path: 'wordBook',
          component: wordBook,
          children: [
            {
              path: 'region',
              component: region
            },
            {
              path: 'department',
              component: department
            },
            {
              path: 'doctorTitle',
              component: doctorTitle
            },
            {
              path: 'hosLevel',
              component: hosLevel
            },
            {
              path: 'skillTag',
              component: skillTag
            }
          ]
        },
        {
          path: 'systemManage',
          component: systemManage,
          children: [
            {
              path: 'role',
              component: systemRole
            },
            {
              path: 'roleAdd',
              component: roleNew
            },
            {
              path: 'user',
              component: systemUser
            }
          ]
        },
        {
          path: 'productManage',
          component: product,
          children: [
            {
              path: 'productManage',
              component: productManage
            },
            {
              path: 'productMain',
              component: productMain
            }
          ]
        },
        {
          path: 'orderManage',
          component: order,
          children: [
            {
              path: 'orderManage',
              component: orderManage
            },
            {
              path: 'orderMain',
              component: orderMain
            },
            {
              path: 'orderWait',
              component: orderWait
            }
          ]
        }
      ]
    }
  ]
})
